<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="model.*"%>
<%@ page import="dao.*"%>
<%@ page import="java.util.*"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	request.setCharacterEncoding("utf-8");
	response.setCharacterEncoding("utf-8");
	String user = (String)session.getAttribute("user");
	if(user!=null && user.equals("1")){
		
	}else {
		response.sendRedirect("Login.jsp");
	}
%>

<%
	String sid = request.getParameter("sid");
	Strategy st = new Strategy();
	st = StrategyDao.getStrategyNoCache(Integer.parseInt(sid));
	if (null == st) {
		st = new Strategy();
	}
	request.setAttribute("st", st);
%>

<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8" />
<title>管理旅游攻略</title>


<jsp:include page="Header.jsp" flush="true"></jsp:include>


<!-- Latest Products -->
<div id="旅游景点">
	<div class="content-lg container">
		<div class="row margin-b-40">
			<div class="col-sm-6">
				<h2>管理旅游攻略</h2>
				<p></p>
			</div>
		</div>
		<!--// end row -->

		<div class="row">
			<form action="<%=request.getContextPath()%>/UeditorUpdate"
				method="post">
				<label for="name">攻略标题</label> <input class="form-control"
					type="text" name="name" value="${st.name }"> 
					<input class="form-control"
					type="hidden" name="sid" value="${st.id }"> 
					<br>
				<!--style给定宽度可以影响编辑器的最终宽度-->
				<script type="text/plain" id="editor">    ${st.info }
</script>

				<input style="width: 200px;" type="submit" class="btn btn-default "
					value="提交">

			</form>
			<script type="text/javascript">
				// 自定义的编辑器配置项,此处定义的配置项将覆盖editor_config.js中的同名配置
				var editorOption = {
					//是否自动清除编辑器初始内容
					autoClearinitialContent : false
				};
				var editor_a = new baidu.editor.ui.Editor(editorOption);
				editor_a.render('editor');
			</script>
			<script type="text/javascript">
				// UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;

				UE.getEditor('myEditor', {
					//这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
					//toolbars:[['FullScreen','simpleupload','Source', 'Undo', 'Redo','Bold','test']],
					//focus时自动清空初始化时的内容
					autoClearinitialContent : true,
					//关闭字数统计
					wordCount : false,
					//关闭elementPath
					elementPathEnabled : false,
					//默认的编辑区域高度
					initialFrameHeight : 300
				//更多其他参数，请参考ueditor.config.js中的配置项
				});
				/* UE.Editor.prototype.getActionUrl = function(action) {
				 //这里很重要，很重要，很重要，要和配置中的imageActionName值一样
				 if (action == 'fileUploadServlet') {
				 //这里调用后端我们写的图片上传接口
				 return 'http://localhost:8081/Test/fileUploadServlet';
				 }else{
				 return this._bkGetActionUrl.call(this, action);
				 }
				 } */
			</script>
		</div>
		<!--// end row -->
	</div>
</div>
<!-- End Latest Products -->

<jsp:include page="Footer.jsp" flush="true"></jsp:include>
<%
	String flag = "";
	String scerror = "";
	flag = (String) request.getAttribute("flag");
	System.out.println("jspflag" + flag);
	if (flag != null) {
		if (flag.equals("1")) {
			scerror = "删除成功。";
			out.print("<script language='javascript'>alert('" + scerror + "');</script>");
		}
		if (flag.equals("0")) {
			scerror = "删除失败。";
			out.print("<script language='javascript'>alert('" + scerror + "');</script>");
		}

	}
	System.out.println(scerror);
%>
<!-- Back To Top -->
<a href="javascript:void(0);" class="js-back-to-top back-to-top">Top</a>

<!-- JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- CORE PLUGINS -->
<script src="vendor/jquery.min.js" type="text/javascript"></script>
<script src="vendor/jquery-migrate.min.js" type="text/javascript"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"
	type="text/javascript"></script>
</body>
<!-- END BODY -->
</html>